home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / ubmalm.zip / ratconf.ub < prev    next >
Text File  |  1990-08-22  |  384b  |  13 lines

  1.    10   *RatConf(A,B,&C(),&Leng)
  2.    20   ' Calculates the continued fraction of the rational a/b.
  3.    30   ' Returns leng = -1 if b = 0.
  4.    40   ' Modeled on the Pascal version
  5.    50   ' 3 May 1990
  6.    60   Leng=-1
  7.    70   if B<1 then return endif
  8.    80   repeat
  9.    90   inc Leng:C(Leng)=A\B
  10.   100   A=B:B=res
  11.   110   until res=0
  12.   120   return ' End of subroutine RatConf.
  13.